//
//  UIButton+Extension.swift
//  Weibo10
//
//  Created by lirenqiang on 16/7/21.
//  Copyright © 2016年 lirenqiang. All rights reserved.
//

import UIKit

extension UIButton {
    
    //便利构造函数
    convenience init(imageName: String, backImageName: String) {
        self.init()
        
        setImage(UIImage(named: imageName), forState: .Normal)
        setImage(UIImage(named: imageName + "_highlighted"), forState: .Highlighted)
        setBackgroundImage(UIImage(named: backImageName), forState: .Normal)
        setBackgroundImage(UIImage(named: backImageName + "_highlighted"), forState: .Highlighted)
        
        //调整大小
        sizeToFit()
    }
}
